package org.mtmi.ui.scenes;

import org.mtmi.ui.M;

/**
 * THE button to access main menu for scenes.
 * 
 */
public class GlobalSceneButton extends AbstractGlobalSceneSideButton
{

	private GlobalScenePopup popup;
	
	/** create edit scene button, register it in scene manager listener */
	public GlobalSceneButton( Scene scene, int flags ) {
		super(scene, flags|M.SCENE_EDITOR_CONTROL );
	}
	
	@Override
	protected void doAction() {
		//open or close popup
		if( popup==null || popup.isDisposed() ) {
			popup = new GlobalScenePopup( getScene(), 0 );
		} else {
			popup.dispose();
			popup=null;
		}
	}

}
